package com.qsd.StudentSystem.service;

import javax.servlet.http.HttpServletRequest;

import com.qsd.common.po.Grade;
import com.qsd.common.po.Student;
import com.qsd.common.util.PageUtil;
import org.springframework.ui.Model;

import com.qsd.common.po.Answer;
import com.qsd.common.po.Course;
import com.qsd.common.enums.ResultStatus;

import java.util.List;

public interface CourseService {
	
	/**
	 * 根据课程ID搜索课程
	 * @param id 课程ID
	 * */
	Course search(Integer id);
	/**
	 * 加入课程
	 * @param id 课程ID
	 * */
	ResultStatus join(Integer id, HttpServletRequest request);
	/**
	 * 退出课程
	 * @param id 课程ID
	 * */
	ResultStatus exit(Integer id, HttpServletRequest request);
	/**
	 * 查询全部试卷根据课程ID,并放到model里
	 * @param courseId 课程ID
	 * @param model 存放数据
	 * */
	void queryPaperByCourseId(Integer courseId, Model model);
	/**
	 * 提交试卷
	 * @param answer 试卷答案信息
	 * */
	ResultStatus complete(Answer answer, HttpServletRequest request);

    List<Grade> fileList(Grade grade, PageUtil page, Student student);
}
